<template>
  <div class="TreeSelect">
    <div class="coent" style="font-size: 18px"></div>
  </div>
</template>
<script>
import {
  ExecProcedure,
  CreateProcess,
  PlatSendTask,
  PrepareCreateProcess,
  FileServerProxy,
} from "../../utils/api";
import dd from "gdt-jsapi";
export default {
  data() {
    return {
      items: [],
      ifID: "",
      TASK_ID: "",
      activeIds: [],
      activeIndex: 0,
      tableData: [],
      indexData: [],
      tableData1: [],
      code1: "",
      xcfy: "",
      rowGuid: "",
      IsKNH: "",
      IsnhzcAdd:"",
    };
  },
  mounted() {
    // if (ZWJSBridge) {
    //   ZWJSBridge.setTitle({
    //     title: "选择人员",
    //   })
    //     .then((res) => {
    //     })
    //     .catch((err) => {
    //     });
    // } else {
    //   // dd.ready(function () {
    //   //   dd.setTitle({
    //   //     title: "我的已办",
    //   //   })
    //   //     .then((res) => {
    //   //     })
    //   //     .catch((err) => {
    //   //       console.error(err);
    //   //     });
    //   // });
    // }
  },
  methods: {
    getData: async function (data) {
      //自动批转
      //判断如果是第一个环节，需要重新写方法，先调用创建流程方法，再自动发送，如果存储过程，则要调用存储过程
      if(this.IsnhzcAdd){
        //浙里办农户自查新增
         let paramsnhzc = {
          accessCode: "2c824ce489ff4cffaa0d77082e6fb648",
          cityCode: window.localStorage.getItem("citycode")
            ? window.localStorage.getItem("citycode")
            : "441300000000",
          params: {
            wfGuid: "{B156B3EF-505A-4C77-897E-D91E639384B6}",
            entityRowGuid: data.ROW_GUID,
            token: window.localStorage.getItem("token"),
          },
        };
        const resnhzc = await FileServerProxy(paramsnhzc);
        let SendFormDatanhzc = JSON.parse(resnhzc.data.data);
        if(SendFormDatanhzc.SendData&&SendFormDatanhzc.SendData.length>0){
          //获取 镇街
            let paer = {
            procName: "up_townaudit",
            dtParams: JSON.stringify([{ I_USERID: "'" + data.cityCode + "'", TYPE: 1 }]),
            token: window.localStorage.getItem("token"),
          };
          let params4 = {
            accessCode: "69db6bece3a7480592e2ec753d1e335e",

            cityCode: window.localStorage.getItem("citycode")
              ? window.localStorage.getItem("citycode")
              : "441300000000",
            params: paer,
          };
          const res = await FileServerProxy(params4);
        }
      }
      else if (this.IsKNH) {
        //判断是否是困难户
        let paramsk = {
          accessCode: "0a709d649c314903a72225edb8bc8c2a",
          cityCode: window.localStorage.getItem("citycode")
            ? window.localStorage.getItem("citycode")
            : "441300000000",
          params: {
            taskId: data.TASK_ID,
            direction: 0, //0是发送  1是打回
            token: window.localStorage.getItem("token"),
          },
        };
        const resk = await FileServerProxy(paramsk);
        var datasendFormknh = JSON.parse(resk.data.data);
        if (datasendFormknh.SendData && datasendFormknh.SendData.length > 0) {
          //鉴定公司直接发给镇街审核
          if (
            this.$route.query.data.NODE_GUID ==
            "{4A140424-C781-402F-A821-502828EB75DA}" ||  this.$route.query.data.NODE_GUID=="{7A93D2DC-D4B9-4E6A-8DC6-4C2FDFBB9D45}"
          ) {
            let strk = this.$route.query.data.ZCITY;
            let paerk = {
              procName: "up_processusername",
              dtParams: JSON.stringify([{ I_USERID: strk, TYPE: 6 }]),
              token: window.localStorage.getItem("token"),
            };
            let procNamesk = {
              accessCode: "69db6bece3a7480592e2ec753d1e335e",
              cityCode: window.localStorage.getItem("citycode")
                ? window.localStorage.getItem("citycode")
                : "441300000000",
              params: paerk,
            };
            const reskh = await FileServerProxy(procNamesk);
            var proZJSHk = JSON.parse(reskh.data.data);
            var  wfguid="";
            if(this.$route.query.data.NODE_GUID =="{4A140424-C781-402F-A821-502828EB75DA}"){
              wfguid="{1EAC593F-12B5-4D5C-A014-FA3617DEAD28}"
            }else if(this.$route.query.data.NODE_GUID =="{7A93D2DC-D4B9-4E6A-8DC6-4C2FDFBB9D45}"){
               wfguid="{1AC2A548-39F6-4F99-BFE1-4497778A22E2}"
            }
            if (proZJSHk.Data && proZJSHk.Data.length > 0) {
              datasendFormknh.SendData.forEach((nodeItem) => {
                var maxtnid = 0; //获取tnid最大值
                if (
                  nodeItem.WFNODEGUID == wfguid &&
                  nodeItem.PTNID == -1
                ) {
                  proZJSHk.Data.forEach((item) => {
                    var tnid = nodeItem.TNID;
                    var newItem = {};
                    maxtnid = maxtnid + 1;
                    newItem.TNID = maxtnid;
                    newItem.PTNID = tnid;
                    newItem.TEXT = item.USERNAME;
                    newItem.USERID = item.USERID;
                    newItem.AUTOCHECKED = true;
                    newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                    newItem.WFNODENAME = nodeItem.WFNODENAME;
                    newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                    newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                    newItem.ISUSER = 1;
                    this.indexData.push(newItem);
                  });
                }
              });
            }
          }
           this.handleGoToNext();
        }
      } else if (this.$route.query.type && this.$route.query.type == "未鉴定") {
        //获取到人员列表
        let params = {
          accessCode: "2c824ce489ff4cffaa0d77082e6fb648",
          cityCode: window.localStorage.getItem("citycode")
            ? window.localStorage.getItem("citycode")
            : "441300000000",
          params: {
            wfGuid: "{5E152A3B-BC71-4302-A1BF-D9E4133F5661}",
            entityRowGuid: data.ROW_GUID,
            token: window.localStorage.getItem("token"),
          },
        };
        const res = await FileServerProxy(params);
        let SendFormData = JSON.parse(res.data.data);
        if (SendFormData.SendData.length > 0) {
          //获取值TYSHXYDM
          let str1 = data.ROW_GUID;
          let paer = {
            procName: "up_housesecurityuser",
            dtParams: JSON.stringify([{ I_USERID: "'" + str1 + "'", TYPE: 5 }]),
            token: window.localStorage.getItem("token"),
          };
          let params4 = {
            accessCode: "69db6bece3a7480592e2ec753d1e335e",

            cityCode: window.localStorage.getItem("citycode")
              ? window.localStorage.getItem("citycode")
              : "441300000000",
            params: paer,
          };
          const res = await FileServerProxy(params4);
          let proEXss = JSON.parse(res.data.data);
          if (proEXss.Data && proEXss.Data.length > 0) {
            let str2 = proEXss.Data[0].TYSHXYDM;
            let paerss = {
              procName: "up_housesecurityuser",
              dtParams: JSON.stringify([
                { I_USERID: "'" + str2 + "'", TYPE: 6 },
              ]),
              token: window.localStorage.getItem("token"),
            };
            let paramsfg = {
              accessCode: "69db6bece3a7480592e2ec753d1e335e",

              cityCode: window.localStorage.getItem("citycode")
                ? window.localStorage.getItem("citycode")
                : "441300000000",
              params: paerss,
            };
            const resss = await FileServerProxy(paramsfg);
            let proEXssJG = JSON.parse(resss.data.data);
            if (proEXssJG.Data && proEXssJG.Data.length > 0) {
              SendFormData.SendData.forEach((nodeItem) => {
                //鉴定公司
                var maxtnid; //获取tnid最大值
                if (
                  nodeItem.WFNODEGUID ==
                    "{53BC28FE-1869-4C12-9683-92B5B059D1BB}" &&
                  nodeItem.PTNID == -1
                ) {
                  var tnid = nodeItem.TNID;
                  var newItem = {};
                  maxtnid = maxtnid + 1;
                  newItem.TNID = maxtnid;
                  newItem.PTNID = tnid;
                  newItem.TEXT = proEXssJG.Data[0].USERNAME;
                  newItem.USERID = proEXssJG.Data[0].USERID;
                  newItem.AUTOCHECKED = true;
                  newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                  newItem.WFNODENAME = nodeItem.WFNODENAME;
                  newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                  newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                  newItem.ISUSER = 1;
                  this.indexData.push(newItem);
                }
              });
            }
          }
        }
        //调用发送接口
        this.handleGoToNext();
      } else if (this.$route.query.list != "true") {
        //获取到人员列表
        let params = {
          accessCode: "2c824ce489ff4cffaa0d77082e6fb648",
          cityCode: window.localStorage.getItem("citycode")
            ? window.localStorage.getItem("citycode")
            : "441300000000",
          params: {
            wfGuid: "{DF6C42D5-2BED-473B-9C4D-DA8C42DAF7E9}",
            entityRowGuid: data.ROW_GUID,
            token: window.localStorage.getItem("token"),
          },
        };
        const res = await FileServerProxy(params);
        let SendFormData = JSON.parse(res.data.data);
        if (SendFormData.SendData.length > 0) {
          //判断是否是镇街审核

          //是鉴定公司
          let str1 = data.JDJGID;
          let paer = {
            procName: "up_processusername",
            dtParams: JSON.stringify([{ I_JDJGID: str1, TYPE: 3 }]),
            token: window.localStorage.getItem("token"),
          };
          let params4 = {
            accessCode: "69db6bece3a7480592e2ec753d1e335e",

            cityCode: window.localStorage.getItem("citycode")
              ? window.localStorage.getItem("citycode")
              : "441300000000",
            params: paer,
          };
          const res = await FileServerProxy(params4);
          let proEX = JSON.parse(res.data.data);
          if (proEX.Data && proEX.Data.length > 0) {
            SendFormData.SendData.forEach((nodeItem) => {
              //鉴定公司
              var maxtnid; //获取tnid最大值
              if (
                nodeItem.WFNODEGUID ==
                  "{C856358A-5B9A-42F0-814D-5BF3F63F5929}" &&
                nodeItem.PTNID == -1
              ) {
                var tnid = nodeItem.TNID;
                var newItem = {};
                maxtnid = maxtnid + 1;
                newItem.TNID = maxtnid;
                newItem.PTNID = tnid;
                newItem.TEXT = proEX.Data[0].USERNAME;
                newItem.USERID = proEX.Data[0].USERID;
                newItem.AUTOCHECKED = true;
                newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                newItem.WFNODENAME = nodeItem.WFNODENAME;
                newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                newItem.ISUSER = 1;
                this.indexData.push(newItem);
              }
            });
          }
        }

        //调用发送接口
        this.handleGoToNext();
      } else {
        //自动批转通过存储过程来获取人员并实现自动发送
        //获取发送人员的接口
        let params = {
          accessCode: "0a709d649c314903a72225edb8bc8c2a",
          cityCode: window.localStorage.getItem("citycode")
            ? window.localStorage.getItem("citycode")
            : "441300000000",
          params: {
            taskId: data.TASK_ID,
            direction: 0, //0是发送  1是打回
            token: window.localStorage.getItem("token"),
          },
        };
        const res = await FileServerProxy(params);
        let datasendForm = JSON.parse(res.data.data);
        //判断等级 发送不同的环节
        if (datasendForm.SendData && datasendForm.SendData.length > 0) {
          //鉴定公司鉴定
          if (
            this.$route.query.data.NODE_GUID ==
              "{C856358A-5B9A-42F0-814D-5BF3F63F5929}" ||
            this.$route.query.data.NODE_GUID ==
              "{7A629180-CF1F-4600-AB4C-33E33ED1E743}"
          ) {
            if (
              this.$route.query.data.JDDJ == "243" ||
              this.$route.query.data.JDDJ == "244"
            ) {
              //调用存储过程
              let str1 = this.$route.query.data.ZCITY;
              let paer = {
                procName: "up_processusername",
                dtParams: JSON.stringify([{ I_USERID: str1, TYPE: 2 }]),
                token: window.localStorage.getItem("token"),
              };
              let procNames = {
                accessCode: "69db6bece3a7480592e2ec753d1e335e",

                cityCode: window.localStorage.getItem("citycode")
                  ? window.localStorage.getItem("citycode")
                  : "441300000000",
                params: paer,
              };
              const res = await FileServerProxy(procNames);
              let proZJSH = JSON.parse(res.data.data);
              if (proZJSH.Data && proZJSH.Data.length > 0) {
                datasendForm.SendData.forEach((nodeItem) => {
                  //镇街备案
                  var maxtnid; //获取tnid最大值
                  if (
                    nodeItem.WFNODEGUID ==
                      "{5EB5555C-D4AB-411A-B781-0DD95F96E544}" &&
                    nodeItem.PTNID == -1
                  ) {
                    proZJSH.Data.forEach((itemzjsh) => {
                      var tnid = nodeItem.TNID;
                      var newItem = {};
                      maxtnid = maxtnid + 1;
                      newItem.TNID = maxtnid;
                      newItem.PTNID = tnid;
                      newItem.TEXT = itemzjsh.USERNAME;
                      newItem.USERID = itemzjsh.USERID;
                      newItem.AUTOCHECKED = true;
                      newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                      newItem.WFNODENAME = nodeItem.WFNODENAME;
                      newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                      newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                      newItem.ISUSER = 1;
                      this.indexData.push(newItem);
                    });
                  }
                });
              }
            } else if (
              this.$route.query.data.JDDJ == "245" ||
              this.$route.query.data.JDDJ == "246"
            ) {
              let str1 = this.$route.query.data.ZCITY;
              let paer = {
                procName: "up_processusername",
                dtParams: JSON.stringify([{ I_USERID: str1, TYPE: 2 }]),
                token: window.localStorage.getItem("token"),
              };
              let procNameBA = {
                accessCode: "69db6bece3a7480592e2ec753d1e335e",

                cityCode: window.localStorage.getItem("citycode")
                  ? window.localStorage.getItem("citycode")
                  : "441300000000",
                params: paer,
              };
              const res = await FileServerProxy(procNameBA);
              let proZJBA = JSON.parse(res.data.data);
              if (proZJBA.Data && proZJBA.Data.length > 0) {
                datasendForm.SendData.forEach((nodeItem) => {
                  //镇街审核
                  var maxtnid; //获取tnid最大值
                  if (
                    nodeItem.WFNODEGUID ==
                      "{E493C582-D97E-4C0D-B6B8-8FF974E8306B}" &&
                    nodeItem.PTNID == -1
                  ) {
                    var tnid = nodeItem.TNID;
                    var newItem = {};
                    maxtnid = maxtnid + 1;
                    newItem.TNID = maxtnid;
                    newItem.PTNID = tnid;
                    newItem.TEXT = proZJBA.Data[0].USERNAME;
                    newItem.USERID = proZJBA.Data[0].USERID;
                    newItem.AUTOCHECKED = true;
                    newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                    newItem.WFNODENAME = nodeItem.WFNODENAME;
                    newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                    newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                    newItem.ISUSER = 1;
                    this.indexData.push(newItem);
                  }
                });
              }
            }
            //判断等级为AB 嘎发给农户
            if (
              this.$route.query.data.JDDJ == "243" ||
              this.$route.query.data.JDDJ == "244"
            ) {
              //发送给农户 存储过程
              let str1 = this.$route.query.data.ZJH;
              let nfper = {
                procName: "up_processusername",
                dtParams: JSON.stringify([{ I_USERID: str1, TYPE: 4 }]),
                token: window.localStorage.getItem("token"),
              };
              let procNameNH = {
                accessCode: "69db6bece3a7480592e2ec753d1e335e",

                cityCode: window.localStorage.getItem("citycode")
                  ? window.localStorage.getItem("citycode")
                  : "441300000000",
                params: nfper,
              };
              const res = await FileServerProxy(procNameNH);
              let proZJNH = JSON.parse(res.data.data);
              if (proZJNH.Data && proZJNH.Data.length > 0) {
                datasendForm.SendData.forEach((nodeItem) => {
                  //农户
                  var maxtnid; //获取tnid最大值
                  if (
                    nodeItem.WFNODEGUID ==
                      "{7A629180-CF1F-4600-AB4C-33E33ED1E743}" &&
                    nodeItem.PTNID == -1
                  ) {
                    var tnid = nodeItem.TNID;
                    var newItem = {};
                    maxtnid = maxtnid + 1;
                    newItem.TNID = maxtnid;
                    newItem.PTNID = tnid;
                    newItem.TEXT = proZJNH.Data[0].USERNAME;
                    newItem.USERID = proZJNH.Data[0].USERID;
                    newItem.AUTOCHECKED = true;
                    newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                    newItem.WFNODENAME = nodeItem.WFNODENAME;
                    newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                    newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                    newItem.ISUSER = 1;
                    this.indexData.push(newItem);
                  }
                });
              }
            }
          } else if (
            this.$route.query.data.NODE_GUID ==
            "{0C256BFE-BC5F-4D63-8AEC-4630EC19F78B}"
          ) {
            //农户危房整治
            //判断如果是修缮直接批准给申请复核鉴定
            // //选择的解危方式为拆除或者重建跳转建房审批环节

            if (
              this.$route.query.listData.JWFS == "265" ||
              this.$route.query.listData.JWFS == "259" ||
              this.$route.query.listData.JWFS == "264"
            ) {
              //265修缮加固    259  腾空防控    264 拆除
              let str1 = "";
              let paer = "";
              if (this.$route.query.listData.JWFS == "265") {
                //修缮加固
                str1 = this.$route.query.listData.ZCITY;
                paer = {
                  procName: "up_processusername",
                  dtParams: JSON.stringify([
                    { I_USERID: this.$route.query.data.ZCITY, I_TYPE: 22 },
                  ]),
                  token: window.localStorage.getItem("token"),
                };
                //接口
                let procNames = {
                  accessCode: "69db6bece3a7480592e2ec753d1e335e",

                  cityCode: window.localStorage.getItem("citycode")
                    ? window.localStorage.getItem("citycode")
                    : "441300000000",
                  params: paer,
                };
                const res = await FileServerProxy(procNames);
                let proZJzz = JSON.parse(res.data.data);
                if (proZJzz.Data && proZJzz.Data.length > 0) {
                  datasendForm.SendData.forEach((nodeItem) => {
                    //申请复核鉴定
                    var maxtnid; //获取tnid最大值
                    if (
                      nodeItem.WFNODEGUID ==
                        "{E3402372-B41D-4B99-9463-27A385E5C212}" &&
                      nodeItem.PTNID == -1
                    ) {
                      proZJzz.Data.forEach((itemzjzz) => {
                        var tnid = nodeItem.TNID;
                        var newItem = {};
                        maxtnid = maxtnid + 1;
                        newItem.TNID = maxtnid;
                        newItem.PTNID = tnid;
                        newItem.TEXT = itemzjzz.USERNAME;
                        newItem.USERID = itemzjzz.USERID;
                        newItem.AUTOCHECKED = true;
                        newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                        newItem.WFNODENAME = nodeItem.WFNODENAME;
                        newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                        newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                        newItem.ISUSER = 1;
                        this.indexData.push(newItem);
                      });
                    }
                  });
                }
              } else if (
                this.$route.query.listData.JWFS == "259" ||
                this.$route.query.listData.JWFS == "264"
              ) {
                //腾空防控
                str1 = this.$route.query.data.ZCITY;
                paer = {
                  procName: "up_processusername",
                  dtParams: JSON.stringify([{ I_USERID: str1, TYPE: 6 }]),
                  token: window.localStorage.getItem("token"),
                };

                let procNames = {
                  accessCode: "69db6bece3a7480592e2ec753d1e335e",

                  cityCode: window.localStorage.getItem("citycode")
                    ? window.localStorage.getItem("citycode")
                    : "441300000000",
                  params: paer,
                };
                const res = await FileServerProxy(procNames);
                let proZJzz = JSON.parse(res.data.data);
                if (proZJzz.Data && proZJzz.Data.length > 0) {
                  datasendForm.SendData.forEach((nodeItem) => {
                    //申请复核鉴定
                    var maxtnid; //获取tnid最大值
                    if (
                      nodeItem.WFNODEGUID ==
                        "{5EB5555C-D4AB-411A-B781-0DD95F96E544}" &&
                      nodeItem.PTNID == -1
                    ) {
                      var tnid = nodeItem.TNID;
                      var newItem = {};
                      maxtnid = maxtnid + 1;
                      newItem.TNID = maxtnid;
                      newItem.PTNID = tnid;
                      newItem.TEXT = proZJzz.Data[0].USERNAME;
                      newItem.USERID = proZJzz.Data[0].USERID;
                      newItem.AUTOCHECKED = true;
                      newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                      newItem.WFNODENAME = nodeItem.WFNODENAME;
                      newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                      newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                      newItem.ISUSER = 1;
                      this.indexData.push(newItem);
                    }
                  });
                }
              }
            } else if (this.$route.query.listData.JWFS == "266") {
              //重建
              let str1 = this.$route.query.data.ROW_GUID; //"this.$route.query.data.ROW_GUID";
              let paer = {
                procName: "up_processdjf",
                dtParams: JSON.stringify([{ I_ROW_GUID: str1 }]),
                token: window.localStorage.getItem("token"),
              };
              let procNames = {
                accessCode: "69db6bece3a7480592e2ec753d1e335e",

                cityCode: window.localStorage.getItem("citycode")
                  ? window.localStorage.getItem("citycode")
                  : "441300000000",
                params: paer,
              };
              const res = await FileServerProxy(procNames);
              let proZJfh = JSON.parse(res.data.data);
              //发送建房审批流程  流程结束
              // setTimeout(() => {
              //   this.$router.push({
              //     path: '/ZLJIndex',
              //   });
              // }, 500);
            }
          } else if (
            this.$route.query.data.NODE_GUID ==
            "{27EE0E9F-607B-4D25-8934-3693F950C095}"
          ) {
            //申请复核鉴定环节
            let str1 = this.$route.query.data.ZCITY;
            let paer = {
              procName: "up_processusername",
              dtParams: JSON.stringify([{ I_USERID: str1, TYPE: 6 }]),
              token: window.localStorage.getItem("token"),
            };
            let procNames = {
              accessCode: "69db6bece3a7480592e2ec753d1e335e",

              cityCode: window.localStorage.getItem("citycode")
                ? window.localStorage.getItem("citycode")
                : "441300000000",
              params: paer,
            };
            const res = await FileServerProxy(procNames);
            let proZJfh = JSON.parse(res.data.data);
            if (proZJfh.Data && proZJfh.Data.length > 0) {
              datasendForm.SendData.forEach((nodeItem) => {
                //申请复核鉴定
                var maxtnid; //获取tnid最大值
                if (
                  nodeItem.WFNODEGUID ==
                    "{5EB5555C-D4AB-411A-B781-0DD95F96E544}" &&
                  nodeItem.PTNID == -1
                ) {
                  proZJfh.Data.forEach((itemzjfh) => {
                    var tnid = nodeItem.TNID;
                    var newItem = {};
                    maxtnid = maxtnid + 1;
                    newItem.TNID = maxtnid;
                    newItem.PTNID = tnid;
                    newItem.TEXT = itemzjfh.USERNAME;
                    newItem.USERID = itemzjfh.USERID;
                    newItem.AUTOCHECKED = true;
                    newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                    newItem.WFNODENAME = nodeItem.WFNODENAME;
                    newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                    newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                    newItem.ISUSER = 1;
                    this.indexData.push(newItem);
                  });
                }
              });
            }
          } else if (
            this.$route.query.data.NODE_GUID ==
            "{B3882940-DD70-48B9-BCDC-544280832103}"
          ) {
            //农户申请补助
            datasendForm.SendData.forEach((nodeItem) => {
              //申请复核鉴定
              var maxtnid; //获取tnid最大值
              if (
                nodeItem.WFNODEGUID ==
                  "{866B1389-FE99-423F-8E71-233331D3D63C}" &&
                nodeItem.PTNID == -1
              ) {
                this.indexData.push(nodeItem);
              }
            });
          } else if (
            this.$route.query.data.NODE_GUID ==
            "{7FC0D26A-55FA-4903-A0D1-2F9CE3398541}"
          ) {
            //疑似危房-危房整治  镇街审核环节
            //判断是AB级从接口获取， 直接结束
            let paer = {
              procName: "up_housesecurityuser",
              dtParams: JSON.stringify([
                {
                  I_USERID: "'" + this.$route.query.data.ROW_GUID + "'",
                  I_TYPE: 7,
                },
              ]),
              token: window.localStorage.getItem("token"),
            };
            //接口
            let procNames = {
              accessCode: "69db6bece3a7480592e2ec753d1e335e",

              cityCode: window.localStorage.getItem("citycode")
                ? window.localStorage.getItem("citycode")
                : "441300000000",
              params: paer,
            };
            const reser = await FileServerProxy(procNames);
            let resData = JSON.parse(reser.data.data);

            if (
              (resData.Data && resData.Data[0].JDDJ == "243") ||
              resData.Data[0].JDDJ == "244"
            ) {
              //掉存储过程发送结束
              let ZJH = "";
              if (
                this.$route.query.data.F_SQFS &&
                this.$route.query.data.F_SQFS == "35"
              ) {
                ZJH = resData.Data[0].ZJH;
              }
              if (
                this.$route.query.data.F_SQFS &&
                this.$route.query.data.F_SQFS == "36"
              ) {
                ZJH =
                  "'" +
                  resData.Data[0].ZJH +
                  "'" +
                  "," +
                  "'" +
                  resData.Data[0].DBRZJH +
                  "'";
              }
              let paerjs = {
                procName: "up_housesecurityuser",
                dtParams: JSON.stringify([
                  {
                    I_USERID: "'" + ZJH + "'",
                    I_TYPE: 1,
                  },
                ]),
                token: window.localStorage.getItem("token"),
              };
              //接口
              let procNamesjs = {
                accessCode: "69db6bece3a7480592e2ec753d1e335e",

                cityCode: window.localStorage.getItem("citycode")
                  ? window.localStorage.getItem("citycode")
                  : "441300000000",
                params: paerjs,
              };
              const resjs = await FileServerProxy(procNamesjs);
              let resDatajs = JSON.parse(resjs.data.data);
              if (resDatajs.Data && resDatajs.Data.length > 0) {
                datasendForm.SendData.forEach((nodeItem) => {
                  //结束
                  var maxtnid; //获取tnid最大值
                  if (
                    nodeItem.WFNODEGUID ==
                      "{C96A6689-E2CE-4091-AE21-6FA6706B0726}" &&
                    nodeItem.PTNID == -1
                  ) {
                    var tnid = nodeItem.TNID;
                    var newItem = {};
                    maxtnid = maxtnid + 1;
                    newItem.TNID = maxtnid;
                    newItem.PTNID = tnid;
                    newItem.TEXT = resDatajs.Data[0].USERNAME;
                    newItem.USERID = resDatajs.Data[0].USERID;
                    newItem.AUTOCHECKED = true;
                    newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                    newItem.WFNODENAME = nodeItem.WFNODENAME;
                    newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                    newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                    newItem.ISUSER = 1;
                    this.indexData.push(newItem);
                  }
                });
              }
            }
            //判断CD级给到农户危改整治
            if (
              (resData.Data && resData.Data[0].JDDJ == "245") ||
              (resData.Data && resData.Data[0].JDDJ == "246")
            ) {
              //给到农户危房改造
              let ZJHwg = "";
              if (
                this.$route.query.data.F_SQFS &&
                this.$route.query.data.F_SQFS == "35"
              ) {
                ZJHwg = resData.Data[0].ZJH;
              }
              if (
                this.$route.query.data.F_SQFS &&
                this.$route.query.data.F_SQFS == "36"
              ) {
                ZJHwg =
                  "'" +
                  resData.Data[0].ZJH +
                  "'" +
                  "," +
                  "'" +
                  resData.Data[0].DBRZJH +
                  "'";
              }
              let paerjswg = {
                procName: "up_housesecurityuser",
                dtParams: JSON.stringify([
                  {
                    I_USERID: "'" + ZJHwg + "'",
                    I_TYPE: 1,
                  },
                ]),
                token: window.localStorage.getItem("token"),
              };
              //接口
              let procNamesjswg = {
                accessCode: "69db6bece3a7480592e2ec753d1e335e",

                cityCode: window.localStorage.getItem("citycode")
                  ? window.localStorage.getItem("citycode")
                  : "441300000000",
                params: paerjswg,
              };
              const resjswg = await FileServerProxy(procNamesjswg);
              let resjswgs = JSON.parse(resjswg.data.data);
              if (resjswgs.Data && resjswgs.Data.length > 0) {
                datasendForm.SendData.forEach((nodeItem) => {
                  //结束
                  var maxtnid; //获取tnid最大值
                  if (
                    nodeItem.WFNODEGUID ==
                      "{6048BDEF-057A-4080-A536-D9EEE89626D7}" &&
                    nodeItem.PTNID == -1
                  ) {
                    var tnid = nodeItem.TNID;
                    var newItem = {};
                    maxtnid = maxtnid + 1;
                    newItem.TNID = maxtnid;
                    newItem.PTNID = tnid;
                    newItem.TEXT = resjswgs.Data[0].USERNAME;
                    newItem.USERID = resjswgs.Data[0].USERID;
                    newItem.AUTOCHECKED = true;
                    newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                    newItem.WFNODENAME = nodeItem.WFNODENAME;
                    newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                    newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                    newItem.ISUSER = 1;
                    this.indexData.push(newItem);
                  }
                });
              }
            }
            // 农户危房改造
          } else if (
            this.$route.query.data.NODE_GUID ==
            "{6048BDEF-057A-4080-A536-D9EEE89626D7}"
          ) {
            //农户危房改造
            let paern = {
              procName: "up_housesecurityuser",
              dtParams: JSON.stringify([
                {
                  I_USERID: "'" + this.$route.query.data.ROW_GUID + "'",
                  I_TYPE: 4,
                },
              ]),
              token: window.localStorage.getItem("token"),
            };
            //接口
            let procNamesn = {
              accessCode: "69db6bece3a7480592e2ec753d1e335e",

              cityCode: window.localStorage.getItem("citycode")
                ? window.localStorage.getItem("citycode")
                : "441300000000",
              params: paern,
            };
            const paerns = await FileServerProxy(procNamesn);
            let resDatan = JSON.parse(paerns.data.data);

            if (
              (resDatan.Data && resDatan.Data[0].JWFS == "265") ||
              (resDatan.Data && resDatan.Data[0].JWFS == "259") ||
              (resDatan.Data && resDatan.Data[0].JWFS == "264")
            ) {
              //265修缮加固    259  腾空防控    264 拆除
              let str1 = "";
              let paer = "";
              if (resDatan.Data && resDatan.Data[0].JWFS == "265") {
                //修缮加固
                let paerntx = {
                  procName: "up_housesecurityuser",
                  dtParams: JSON.stringify([
                    {
                      I_USERID: resDatan.Data[0].TYSHXYDM,
                      I_TYPE: 6,
                    },
                  ]),
                  token: window.localStorage.getItem("token"),
                };
                //接口
                let procNamesntx = {
                  accessCode: "69db6bece3a7480592e2ec753d1e335e",

                  cityCode: window.localStorage.getItem("citycode")
                    ? window.localStorage.getItem("citycode")
                    : "441300000000",
                  params: paerntx,
                };
                const paernstx = await FileServerProxy(procNamesntx);
                let resDatantx = JSON.parse(paernstx.data.data);
                if (resDatantx.Data && resDatantx.Data.length > 0) {
                  datasendForm.SendData.forEach((nodeItem) => {
                    //房屋安全复核鉴定
                    var maxtnid; //获取tnid最大值
                    if (
                      nodeItem.WFNODEGUID ==
                        "{B1C06F47-987A-49DF-BD93-2B193A7E7189}" &&
                      nodeItem.PTNID == -1
                    ) {
                      var tnid = nodeItem.TNID;
                      var newItem = {};
                      maxtnid = maxtnid + 1;
                      newItem.TNID = maxtnid;
                      newItem.PTNID = tnid;
                      newItem.TEXT = resDatantx.Data[0].USERNAME;
                      newItem.USERID = resDatantx.Data[0].USERID;
                      newItem.AUTOCHECKED = true;
                      newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                      newItem.WFNODENAME = nodeItem.WFNODENAME;
                      newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                      newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                      newItem.ISUSER = 1;
                      this.indexData.push(newItem);
                    }
                  });
                }
              } else if (
                (resDatan.Data && resDatan.Data[0].JWFS == "259") ||
                (resDatan.Data && resDatan.Data[0].JWFS == "264")
              ) {
                //腾空防控
                let paernt = {
                  procName: "up_housesecurityuser",
                  dtParams: JSON.stringify([
                    {
                      I_USERID: resDatan.Data[0].ZCITY,
                      I_TYPE: 3,
                    },
                  ]),
                  token: window.localStorage.getItem("token"),
                };
                //接口
                let procNamesnt = {
                  accessCode: "69db6bece3a7480592e2ec753d1e335e",

                  cityCode: window.localStorage.getItem("citycode")
                    ? window.localStorage.getItem("citycode")
                    : "441300000000",
                  params: paernt,
                };
                const paernst = await FileServerProxy(procNamesnt);
                let resDatant = JSON.parse(paernst.data.data);
                if (resDatant.Data && resDatant.Data.length > 0) {
                  datasendForm.SendData.forEach((nodeItem) => {
                    //镇街复核
                    var maxtnid; //获取tnid最大值
                    if (
                      nodeItem.WFNODEGUID ==
                        "{6892536C-6FFA-4B5D-8F9E-1B403F70D670}" &&
                      nodeItem.PTNID == -1
                    ) {
                      var tnid = nodeItem.TNID;
                      var newItem = {};
                      maxtnid = maxtnid + 1;
                      newItem.TNID = maxtnid;
                      newItem.PTNID = tnid;
                      newItem.TEXT = resDatant.Data[0].USERNAME;
                      newItem.USERID = resDatant.Data[0].USERID;
                      newItem.AUTOCHECKED = true;
                      newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                      newItem.WFNODENAME = nodeItem.WFNODENAME;
                      newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                      newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                      newItem.ISUSER = 1;
                      this.indexData.push(newItem);
                    }
                  });
                }
              }
            } else if (resDatan.Data && resDatan.Data[0].JWFS == "266") {
              //重建
              let ZJHwgs = "";
              if (
                this.$route.query.data.F_SQFS &&
                this.$route.query.data.F_SQFS == "35"
              ) {
                ZJHwgs = resDatan.Data[0].ZJH;
              }
              if (
                this.$route.query.data.F_SQFS &&
                this.$route.query.data.F_SQFS == "36"
              ) {
                ZJHwgs =
                  "'" +
                  resDatan.Data[0].ZJH +
                  "'" +
                  "," +
                  "'" +
                  resDatan.Data[0].DBRZJH +
                  "'";
              }
              let paerjswgs = {
                procName: "up_housesecurityuser",
                dtParams: JSON.stringify([
                  {
                    I_USERID: "'" + ZJHwgs + "'",
                    I_TYPE: 1,
                  },
                ]),
                token: window.localStorage.getItem("token"),
              };
              //接口
              let procNamesjswgs = {
                accessCode: "69db6bece3a7480592e2ec753d1e335e",

                cityCode: window.localStorage.getItem("citycode")
                  ? window.localStorage.getItem("citycode")
                  : "441300000000",
                params: paerjswgs,
              };
              const resjswgs = await FileServerProxy(procNamesjswgs);
              //发送建房审批流程  流程结束
              // setTimeout(() => {
              //   this.$router.push({
              //     path: '/ZLJIndex',
              //   });
              // }, 500);
            }
            //镇街复核
          } else if (
            this.$route.query.data.NODE_GUID ==
            "{6892536C-6FFA-4B5D-8F9E-1B403F70D670}"
          ) {
            //镇街复核
            let paerfjzj = {
              procName: "up_housesecurityuser",
              dtParams: JSON.stringify([
                {
                  I_USERID: '"' + this.$route.query.data.ROW_GUID + '"',
                  TYPE: 4,
                },
              ]),
              token: window.localStorage.getItem("token"),
            };
            let procNameBAfjzj = {
              accessCode: "69db6bece3a7480592e2ec753d1e335e",

              cityCode: window.localStorage.getItem("citycode")
                ? window.localStorage.getItem("citycode")
                : "441300000000",
              params: paerfjzj,
            };
            const resfjzj = await FileServerProxy(procNameBAfjzj);
            let resDataZj = JSON.parse(resfjzj.data.data);
            if (
              resDataZj.Data &&
              (resDataZj.Data[0].JDDJ == 243 ||
                resDataZj.Data[0].JDDJ == 244) &&
              resDataZj.Data[0].KNLX == 5
            ) {
              let ZJHzj = "";
              if (
                this.$route.query.data.F_SQFS &&
                this.$route.query.data.F_SQFS == "35"
              ) {
                ZJHzj = resDataZj.Data[0].ZJH;
              }
              if (
                this.$route.query.data.F_SQFS &&
                this.$route.query.data.F_SQFS == "36"
              ) {
                ZJHzj =
                  "'" +
                  resDataZj.Data[0].ZJH +
                  "'" +
                  "," +
                  "'" +
                  resDataZj.Data[0].DBRZJH +
                  "'";
              }
              let parsefkzjll = {
                procName: "up_housesecurityuser",
                dtParams: JSON.stringify([{ I_USERID: ZJHzj, I_TYPE: 1 }]),
                token: window.localStorage.getItem("token"),
              };
              let procNameBAfjzjll = {
                accessCode: "69db6bece3a7480592e2ec753d1e335e",

                cityCode: window.localStorage.getItem("citycode")
                  ? window.localStorage.getItem("citycode")
                  : "441300000000",
                params: parsefkzjll,
              };
              const resfjzjll = await FileServerProxy(procNameBAfjzjll);
              let proZJBAfll = JSON.parse(resfjzjll.data.data);

              if (proZJBAfll.Data && proZJBAfll.Data.length > 0) {
                datasendForm.SendData.forEach((nodeItem) => {
                  //申请建房补助
                  var maxtnid; //获取tnid最大值
                  if (
                    nodeItem.WFNODEGUID ==
                      "{5453C120-C811-412D-8C2A-3819D55CC790}" &&
                    nodeItem.PTNID == -1
                  ) {
                    var tnid = nodeItem.TNID;
                    var newItem = {};
                    maxtnid = maxtnid + 1;
                    newItem.TNID = maxtnid;
                    newItem.PTNID = tnid;
                    newItem.TEXT = proZJBAfll.Data[0].USERNAME;
                    newItem.USERID = proZJBAfll.Data[0].USERID;
                    newItem.AUTOCHECKED = true;
                    newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                    newItem.WFNODENAME = nodeItem.WFNODENAME;
                    newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                    newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                    newItem.ISUSER = 1;
                    this.indexData.push(newItem);
                  }
                });
              }
            }
            if (
              resDataZj.Data &&
              (resDataZj.Data[0].JDDJ == 243 ||
                resDataZj.Data[0].JDDJ == 244) &&
              resDataZj.Data[0].KNLX == 6
            ) {
              //发送结束
              let ZJHyy = "";
              if (
                this.$route.query.data.F_SQFS &&
                this.$route.query.data.F_SQFS == "35"
              ) {
                ZJHyy = resDataZj.Data[0].ZJH;
              }
              if (
                this.$route.query.data.F_SQFS &&
                this.$route.query.data.F_SQFS == "36"
              ) {
                ZJHyy =
                  "'" +
                  resDataZj.Data[0].ZJH +
                  "'" +
                  "," +
                  "'" +
                  resDataZj.Data[0].DBRZJH +
                  "'";
              }
              let paerjshh = {
                procName: "up_housesecurityuser",
                dtParams: JSON.stringify([
                  {
                    I_USERID: ZJHyy,
                    I_TYPE: 1,
                  },
                ]),
                token: window.localStorage.getItem("token"),
              };
              //接口
              let procNamesjshh = {
                accessCode: "69db6bece3a7480592e2ec753d1e335e",

                cityCode: window.localStorage.getItem("citycode")
                  ? window.localStorage.getItem("citycode")
                  : "441300000000",
                params: paerjshh,
              };
              const resjshh = await FileServerProxy(procNamesjshh);
              let resDatajshh = JSON.parse(resjshh.data.data);
              if (resDatajshh.Data && resDatajshh.Data.length > 0) {
                datasendForm.SendData.forEach((nodeItem) => {
                  //结束
                  var maxtnid; //获取tnid最大值
                  if (
                    nodeItem.WFNODEGUID ==
                      "{C96A6689-E2CE-4091-AE21-6FA6706B0726}" &&
                    nodeItem.PTNID == -1
                  ) {
                    var tnid = nodeItem.TNID;
                    var newItem = {};
                    maxtnid = maxtnid + 1;
                    newItem.TNID = maxtnid;
                    newItem.PTNID = tnid;
                    newItem.TEXT = resDatajshh.Data[0].USERNAME;
                    newItem.USERID = resDatajshh.Data[0].USERID;
                    newItem.AUTOCHECKED = true;
                    newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                    newItem.WFNODENAME = nodeItem.WFNODENAME;
                    newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                    newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                    newItem.ISUSER = 1;
                    this.indexData.push(newItem);
                  }
                });
              }
            }
          } else if (
            this.$route.query.data.NODE_GUID ==
            "{53BC28FE-1869-4C12-9683-92B5B059D1BB}"
          ) {
            //房屋安全鉴定
            let paerfj = {
              procName: "up_housesecurityuser",
              dtParams: JSON.stringify([
                {
                  I_USERID: '"' + this.$route.query.data.ROW_GUID + '"',
                  TYPE: 5,
                },
              ]),
              token: window.localStorage.getItem("token"),
            };
            let procNameBAfj = {
              accessCode: "69db6bece3a7480592e2ec753d1e335e",

              cityCode: window.localStorage.getItem("citycode")
                ? window.localStorage.getItem("citycode")
                : "441300000000",
              params: paerfj,
            };
            const resfj = await FileServerProxy(procNameBAfj);
            let parsefk = {
              procName: "up_housesecurityuser",
              dtParams: JSON.stringify([
                {
                  I_USERID: JSON.parse(resfj.data.data).Data[0].ZCITY,
                  TYPE: 2,
                },
              ]),
              token: window.localStorage.getItem("token"),
            };
            procNameBAfj.params = parsefk;
            const res1fj = await FileServerProxy(procNameBAfj);
            let proZJBAfl = JSON.parse(res1fj.data.data);

            if (proZJBAfl.Data && proZJBAfl.Data.length > 0) {
              datasendForm.SendData.forEach((nodeItem) => {
                //镇街备案
                var maxtnid; //获取tnid最大值
                if (
                  nodeItem.WFNODEGUID ==
                    "{7FC0D26A-55FA-4903-A0D1-2F9CE3398541}" &&
                  nodeItem.PTNID == -1
                ) {
                  var tnid = nodeItem.TNID;
                  var newItem = {};
                  maxtnid = maxtnid + 1;
                  newItem.TNID = maxtnid;
                  newItem.PTNID = tnid;
                  newItem.TEXT = proZJBAfl.Data[0].USERNAME;
                  newItem.USERID = proZJBAfl.Data[0].USERID;
                  newItem.AUTOCHECKED = true;
                  newItem.WFNODEGUID = nodeItem.WFNODEGUID;
                  newItem.WFNODENAME = nodeItem.WFNODENAME;
                  newItem.WFNODETYPE = nodeItem.WFNODETYPE;
                  newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
                  newItem.ISUSER = 1;
                  this.indexData.push(newItem);
                }
              });
            }
          } else if (
            this.$route.query.data.NODE_GUID ==
            "{C96A6689-E2CE-4091-AE21-6FA6706B0726}"
          ) {
            //直接结束
            datasendForm.SendData.forEach((nodeItem) => {
              //申请复核鉴定
              var maxtnid; //获取tnid最大值
              if (
                nodeItem.WFNODEGUID ==
                  "{C96A6689-E2CE-4091-AE21-6FA6706B0726}" &&
                nodeItem.PTNID == -1
              ) {
                this.indexData.push(nodeItem);
              }
            });
            // datasendForm.SendData.forEach((nodeItem) => {
            //       //结束
            //       var maxtnid; //获取tnid最大值
            //       if (
            //         nodeItem.WFNODEGUID ==
            //           "{C96A6689-E2CE-4091-AE21-6FA6706B0726}" &&
            //         nodeItem.PTNID == -1
            //       ) {
            //         var tnid = nodeItem.TNID;
            //         var newItem = {};
            //         maxtnid = maxtnid + 1;
            //         newItem.TNID = maxtnid;
            //         newItem.PTNID = tnid;
            //         newItem.TEXT = resDatajshh.Data[0].USERNAME;
            //         newItem.USERID = resDatajshh.Data[0].USERID;
            //         newItem.AUTOCHECKED = true;
            //         newItem.WFNODEGUID = nodeItem.WFNODEGUID;
            //         newItem.WFNODENAME = nodeItem.WFNODENAME;
            //         newItem.WFNODETYPE = nodeItem.WFNODETYPE;
            //         newItem.SINGLEASSIGN = nodeItem.SINGLEASSIGN;
            //         newItem.ISUSER = 1;
            //         this.indexData.push(newItem);
            //       }
            //     });
          } else if (
            this.$route.query.data.WF_GUID ==
            "{AFA7FC7F-BDBD-46EA-ABD2-EEF0766096D2}" &&
            this.$route.query.data.NODE_GUID ==
            "{3F794E03-9253-439B-8332-79BCBDE26294}" ||
            this.$route.query.data.WF_GUID ==
            "{AFA7FC7F-BDBD-46EA-ABD2-EEF0766096D2}" &&
            this.$route.query.data.NODE_GUID ==
            "{B4FCC404-5D84-4F9A-B5A2-243ECE2FB244}"
          ) {
            //发送环节node_guid
            let FS_NODE_GUID = "{97897B6B-B858-4EB9-B7D8-0C1376425864}";
            let FS_NODE_NAME = "镇街审核"
            //鉴定公司鉴定
            if(this.$route.query.data.NODE_GUID == "{B4FCC404-5D84-4F9A-B5A2-243ECE2FB244}"){
                FS_NODE_GUID = "{33E8B5E8-77B7-4E9F-9123-3377AD2C0AC9}";
                FS_NODE_NAME = "镇街备案"
            } 
            let procNames = {
                accessCode: "69db6bece3a7480592e2ec753d1e335e",
                cityCode: window.localStorage.getItem("citycode")? window.localStorage.getItem("citycode"): "441300000000",
                params: {
                    procName: "up_processusername",
                    dtParams: JSON.stringify([
                        { I_USERID: this.$route.query.data.F_SUOZAIZHEN, I_TYPE: 6 },
                    ]),
                    token: window.localStorage.getItem("token"),
                }
            };
            const res = await FileServerProxy(procNames);
            let pro = JSON.parse(res.data.data);
            console.log(pro,datasendForm)
            if (pro.Data && pro.Data.length > 0) {
                var maxtnid; //获取tnid最大值
                pro.Data.forEach((itemzjzz) => {
                    var newItem = {};
                    maxtnid = maxtnid + 1;
                    newItem.TNID = maxtnid;
                    newItem.PTNID = 1;
                    newItem.TEXT = itemzjzz.USERNAME;
                    newItem.USERID = itemzjzz.USERID;
                    newItem.AUTOCHECKED = true;
                    newItem.WFNODEGUID = FS_NODE_GUID;
                    newItem.WFNODENAME = FS_NODE_NAME;
                    newItem.WFNODETYPE = 2;
                    newItem.SINGLEASSIGN = true;
                    newItem.ISUSER = 1;
                    this.indexData.push(newItem);
                });
            }
          }
        }
        this.handleGoToNext();
      }
    },
    onClickLeft() {
      this.$router.back(-1);
    },
    handleGoToNext: async function () {
      //判断当前是否选择了人员
      if (this.indexData.length > 0) {
        if (this.$route.query.type && this.$route.query.type == "未鉴定") {
          let params = {
            accessCode: "3ec88931e2bf429d9ceadff8697b6772",
            cityCode: window.localStorage.getItem("citycode")
              ? window.localStorage.getItem("citycode")
              : "441300000000",
            params: {
              bizGuid: "3166e7dc-83d1-4471-a84d-368146e5add6",
              wfGuid: "{5E152A3B-BC71-4302-A1BF-D9E4133F5661}",
              entityRowGuid: this.$route.query.data.ROW_GUID,
              token: window.localStorage.getItem("token"),
            },
          };
          const resCreate = await FileServerProxy(params);
          let resCreateData = JSON.parse(resCreate.data.data);
          this.$route.query.data.TASK_ID = resCreateData.TaskId;
        } else if (this.$route.query.list != "true" && !this.IsKNH) {
          let params = {
            accessCode: "3ec88931e2bf429d9ceadff8697b6772",
            cityCode: window.localStorage.getItem("citycode")
              ? window.localStorage.getItem("citycode")
              : "441300000000",
            params: {
              bizGuid: "845b7b9f-7630-4511-a1aa-0f8e8355cf89",
              wfGuid: "{DF6C42D5-2BED-473B-9C4D-DA8C42DAF7E9}",
              entityRowGuid: this.$route.query.data.ROW_GUID,
              token: window.localStorage.getItem("token"),
            },
          };
          const resCreate = await FileServerProxy(params);
          let resCreateData = JSON.parse(resCreate.data.data);
          this.$route.query.data.TASK_ID = resCreateData.TaskId;
        }
        if (this.$route.query.data.TASK_ID) {
          let plantask = {
            accessCode: "c52bcf7cf3fb42bb9fbcd9b91e97d411",
            cityCode: window.localStorage.getItem("citycode")
              ? window.localStorage.getItem("citycode")
              : "441300000000",
            params: {
              taskId: this.$route.query.data.TASK_ID,
              direction: 0,
              wfBoxGuid: "",
              actionText: "同意",
              taskName: "",
              wfGuid: this.xcfy,
              sendNodes: JSON.stringify(this.indexData),
              token: window.localStorage.getItem("token"),
            },
          };
          const respl = await FileServerProxy(plantask);
          let data = JSON.parse(respl.data.data).Success;
          if (data) {
            //判断如果是农户危房整治 发送多个人 一个人发走  一个人没件
            if (
              this.$route.query.data.NODE_GUID ==
              "{0C256BFE-BC5F-4D63-8AEC-4630EC19F78B}"
            ) {
              //调用存储过程
              let str1 = this.$route.query.data.PROC_GUID;
              let paerauto = {
                procName: "up_processusername",
                dtParams: JSON.stringify([{ I_USERID: str1, I_TYPE: 7 }]),
                token: window.localStorage.getItem("token"),
              };
              let procNameAuto = {
                accessCode: "69db6bece3a7480592e2ec753d1e335e",

                cityCode: window.localStorage.getItem("citycode")
                  ? window.localStorage.getItem("citycode")
                  : "441300000000",
                params: paerauto,
              };
              const res = await FileServerProxy(procNameAuto);
            }
            // 房屋安全鉴定
            // if (
            //   this.$route.query.data.NODE_GUID ==
            //   "{53BC28FE-1869-4C12-9683-92B5B059D1BB}"
            // ) {
            //   //调用存储过程
            //   let str1 = "'"+this.$route.query.data.ROW_GUID+"'";
            //   let paerauto = {
            //     procName: "up_housesecurity",
            //     dtParams: JSON.stringify([{ I_USERID: str1, I_TYPE: 6 }]),
            //     token: window.localStorage.getItem("token"),
            //   };
            //   let procNameAuto = {
            //     accessCode: "69db6bece3a7480592e2ec753d1e335e",
            //
            //     cityCode: window.localStorage.getItem("citycode")
            //       ? window.localStorage.getItem("citycode")
            //       : "",
            //     params: paerauto,
            //   };
            //   const res = await FileServerProxy(procNameAuto);
            // }
            if (
              this.$route.query.data.NODE_GUID ==
              "{6048BDEF-057A-4080-A536-D9EEE89626D7}"
            ) {
              //农户危房改造--危房整治流程
              let paernf = {
                procName: "up_housesecurityuser",
                dtParams: JSON.stringify([
                  {
                    I_USERID: "'" + this.$route.query.data.ROW_GUID + "'",
                    I_TYPE: 7,
                  },
                ]),
                token: window.localStorage.getItem("token"),
              };
              //接口
              let procNamesnf = {
                accessCode: "69db6bece3a7480592e2ec753d1e335e",

                cityCode: window.localStorage.getItem("citycode")
                  ? window.localStorage.getItem("citycode")
                  : "441300000000",
                params: paernf,
              };
              const paernsf = await FileServerProxy(procNamesnf);
              let resDatanf = JSON.parse(paernsf.data.data);
              if (resDatanf.Data && resDatanf.Data.length > 0) {
                if (resDatanf.Data[0].JWFS == "266") {
                  let paernfh = {
                    procName: "up_processdjf",
                    dtParams: JSON.stringify([
                      {
                        I_USERID: "'" + this.$route.query.data.ROW_GUID + "'",
                      },
                    ]),
                    token: window.localStorage.getItem("token"),
                  };
                  //接口
                  let procNamesnfh = {
                    accessCode: "69db6bece3a7480592e2ec753d1e335e",

                    cityCode: window.localStorage.getItem("citycode")
                      ? window.localStorage.getItem("citycode")
                      : "441300000000",
                    params: paernfh,
                  };
                  const paernsfh = await FileServerProxy(procNamesnfh);
                } else {
                  let paernfhl = {
                    procName: "up_housesecurityuser",
                    dtParams: JSON.stringify([
                      {
                        I_USERID: "'" + this.$route.query.data.ROW_GUID + "'",
                        I_TYPE: 9,
                      },
                    ]),
                    token: window.localStorage.getItem("token"),
                  };
                  //接口
                  let procNamesnfhl = {
                    accessCode: "69db6bece3a7480592e2ec753d1e335e",

                    cityCode: window.localStorage.getItem("citycode")
                      ? window.localStorage.getItem("citycode")
                      : "441300000000",
                    params: paernfhl,
                  };
                  const paernsfhl = await FileServerProxy(procNamesnfhl);
                }
              }
            }
            this.$toast.success("成功！");
            if (this.$route.query.type && this.$route.query.type == "未鉴定") {
              setTimeout(() => {
                this.$router.push({
                  path: "/houseAppraisal",
                });
              }, 500);
            }
          }

          setTimeout(() => {
            this.$router.push({
              path: '/ZLJIndex',
            });
          }, 500);
        }
      }
    },
  },
  mounted() {
    debugger;
    //接收浙里办传来的参数
    this.row = this.$route.query.data;
    //判断是否是困难户
    if (this.row.KNLX == 5) {
      this.IsKNH = true;
    } else {
      this.IsKNH = false;
    }
    if(this.$route.query&&this.$route.query.IsnhzcAdd){
      this.IsnhzcAdd=true;
    }
    this.getData(this.$route.query.data);
    // //调用视图减少人员选择
  },
};
</script>
<style lang="scss" scoped>
.TreeSelect {
  height: 100vh;
  background: #fff;
  font-size: 0.2em;
}
</style>
